package com.example.dbcms.controller.admin;

import com.example.dbcms.service.TimedTaskService;
import com.example.dbcms.utils.ResultVoUtil;
import com.example.dbcms.vo.ResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@Api("管理员首页路由")
@RequestMapping("/admin/sys")
public class TaskController {

    @Autowired
    private TimedTaskService timedTaskService;

    /**
     * 手动刷新定时任务
     * @return
     */
    @ApiOperation("手动刷新定时任务")
    @GetMapping("/refreshPropertyFee")
    @ResponseBody
    public ResultVo refresh() {
        return timedTaskService.refreshPropertyFee();
    }

    /**
     * 手动刷新定时任务
     * @return
     */
    @ApiOperation("手动刷新定时任务")
    @GetMapping("/refreshParkingFee")
    @ResponseBody
    public ResultVo refreshParkingFee() {
        return timedTaskService.refreshParkingFee();
    }
}
